-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#5569 Add compliance with Trusted Types #5575
Conversation
@martgil this PR is ready for review, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is also a good idea to update some of the few options for the DOMPurify configuration option to return trusted type by adding the RETURN_TRUSTED_TYPE
property set to true when DOMPurify.sanitize()
is used:
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM: true; }): HTMLElement; |
Reference:
https://github.com/cure53/DOMPurify?tab=readme-ov-file#what-about-dompurify-and-trusted-types
https://web.dev/articles/trusted-types#use_a_library
Nice suggestion, I'll check this property and also standard dompurify types from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dompurify as we currently use outdated types for v2. |
@martgil I tried to add So let's plan this change to the next milestone (I created separate issue for it - #5576), as we need to finish current release in the beginning of February, before Gmail policy update. |
I understood completely. This PR also looks good. thanks!
Okay, thanks! I'll assigned it to myself to work on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thank you.
This PR adds Trusted Types policy for compatibility with upcoming Gmail policy update
close #5569
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):